<script setup lang="ts">
import defImg from '@/assets/diy/app-icon.svg'
const props = withDefaults(
  defineProps<{
    avatar?: string
    title: string
    description?: string
  }>(),
  {
    avatar: '',
    title: '',
    description: ''
  }
)

function toHome() {
  const url = window.location.href.split('?')[0];
  window.location.href = url + `?uploadMode=local`
}

</script>
<template>
  <div class="opening-remarks">
      <img class="opening-remarks-avatar" :src="defImg" alt="" @click="toHome">
      <div class="opening-remarks-title">{{ props.title }}</div>
      <span class="opening-remarks-tag">Chat BI</span>
  </div>
</template>
<style scoped lang="scss">
.opening-remarks {
  //width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  background: linear-gradient( 90deg, #E7EEFF 0%, #DAEAFF 48%, #DAF4FF 100%);
  border-radius: 8px 8px 0 0;
  height: 60px;
  &-avatar {
    width: 40px;
    height: 40px;
    margin-left: 20px;
    cursor: pointer;
  }
  &-title {
    font-family: PingFang SC, PingFang SC;
    font-weight: 500;
    font-size: 18px;
    color: #333333;
    line-height: 18px;
    text-align: left;
    font-style: normal;
    text-transform: none;
    padding:  0 8px;
  }
  &-tag {
    background: rgba(48,103,239,0.1);
    border-radius: 4px 4px 4px 4px;
    border: 1px solid rgba(48,103,239,0.4);
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 12px;
    color: #3067EF;
    line-height: 18px;
    text-align: left;
    font-style: normal;
    text-transform: none;
    padding: 3px 8px;
  }
}
</style>
